mixin paginator(pathPrefix)

    -const pages = Math.ceil(total/pagesize)
    if pages
        .page__paginator
            ul.paginator__list.clearfix
                if page > 0
                    li.paginator__item.paginator__nav
                        a(href=`${pathPrefix}?page=${page}`)
                            i.icon.icon-prev
                -for (var index = 0; index < pages; index++)
                    li.paginator__item
                        if index === page
                            span #{index + 1}
                        else
                            a(href=`${pathPrefix}?page=${index + 1}`) #{index + 1}
                if pages > 1 && page < pages - 1
                    li.paginator__item.paginator__nav
                        a(href=`${pathPrefix}?page=${page + 2}`)
                            i.icon.icon-next
